#include <QtGui/QApplication>
#include "mainwindow.h"

/**
  * @brief Custom message handler to reroute all qDebug(), etc. functions in production code to a system log.
  *
  * @param type
  * @param msg
  */
void msgHandler(QtMsgType type, const char * msg) {
    switch (type) {
    case QtDebugMsg:
        fprintf(stderr, "Debug: %s\n", msg);
        break;
    case QtWarningMsg:
        fprintf(stderr, "Warning: %s\n", msg);
        break;
    case QtCriticalMsg:
        fprintf(stderr, "Critical: %s\n", msg);
        break;
    case QtFatalMsg:
        fprintf(stderr, "Fatal: %s\n", msg);
        abort();
    }
}

int main(int argc, char *argv[])
{
    //qInstallMsgHandler(msgHandler);
    QApplication a(argc, argv);
    a.setAttribute(Qt::AA_DontShowIconsInMenus);
    MainWindow w;
    w.show();
    //w.showCtrlDialog(true);

    return a.exec();
}
